<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="${pageContext.request.contextPath }/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />

<title>赛事信息表删除页面</title>
</head>
<body>
<%@include file="../navigationBar.jsp"%>
	<div class="container">
		<div class="row" role="content">
			<div class="col-md-10 col-md-offset-2">
				<table class="table table-striped">
					<caption>所有赛事信息表</caption>
					<thead>
						<tr>
							<th>信息表id</th>
							<th>场地id</th>
							<th>申请人姓名</th>
							<th>申请人电话</th>
							<th>赛事名称</th>
							<th>赛事项目</th>
							<th>开始时间</th>
							<th>结束时间</th>
							<th>负责人</th>
							<th>选中删除</th>
						</tr>
					</thead>
					<tbody>
						<s:iterator value="list">
							<tr>
								<td><s:property value="matchInfoID" /></td>
								<td><s:property value="placeID" /></td>
								<td><s:property value="proposerName" /></td>
								<td><s:property value="proposerPhone" /></td>
								<td><s:property value="matchName" /></td>
								<td><s:property value="matchProject" /></td>
								<td><s:property value="startTime" /></td>
								<td><s:property value="endTime" /></td>
								<td><s:property value="personInCharge" /></td>
								<td><input type="checkbox" name="deleteList" value="<s:property value="matchInfoID"/>"></td>
							</tr>
						</s:iterator>
					</tbody>	
				</table>
			</div>
			<div class="col-md-1 pull-right">
				<button type="button" class="btn btn-default" data-toggle="modal"
		data-target="#mymodal" id="deleteAll">删除</button>
			</div>
		</div>
		
		<div class="row" role="pager"> 
			<div class="col-md-3 col-md-offset-6">
				<s:if test="currPage != 1">
					<a href="matchInfo_delete.action?currPage=1">首页</a>
					<a href="matchInfo_delete.action?currPage=<s:property value="currPage-1"/>">上一页</a>
				</s:if>
				<span>第<s:property value="currPage"/>/<s:property value="totalPage"/>页</span>
				<s:if test="currPage != totalPage">
					<a href="matchInfo_delete.action?currPage=<s:property value="currPage+1"/>">下一页</a>
					<a href="matchInfo_delete.action?currPage=<s:property value="totalPage"/>">尾页</a>
				</s:if>
			</div>
		</div> 
	</div>
	<div class="modal fade" id="mymodal" aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<button class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title">确定要删除这些赛事信息表吗？</h4>
				</div>
				<div class="modal-body">
					<a class="btn btn-success" id="yes">确定</a>
					<button class="btn btn-default" data-dismiss="modal">取消</button>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="${pageContext.request.contextPath }/bootstrap/js/jquery-3.2.0.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/bootstrap/js/bootstrap.js"></script>
	<script type="text/javascript">
		$("#deleteAll").click(function(){
			var idList = "";	
			$("[name = deleteList]:checkbox").each(function(){$
				if($(this).is(":checked")){
					idList += $(this).attr("value") + ",";
					}
				});
			$("#yes").attr("href","matchInfo_deleteAll.action?idList="+idList);
		});
	</script>
</body>
</html>